package com.swift.authority.core.user.request;

import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.List;

/**
 * @author Ldanniel
 * @description :
 * @date 2022/07/10 9:52
 * @since open jdk 1.8
 */
@Data
public class UserReq implements UserDetails {
    private String id;
    private String username;
    private String gender;
    private String password;
    private String userImg;
    private String userAddress;
    private String email;
    private String emailVerified;
    private String createTime;
    private List<GrantedAuthority> grantedAuthorityList;
    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return grantedAuthorityList;
    }

    @Override
    public String getPassword() {
        return password;
    }

    @Override
    public String getUsername() {
        return username;
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }
}
